

using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Yozeev.BusinessLogic;

namespace Yozeev.EntityMapper.TravelAgencys
{
    public class TravelAgencyCfg : IEntityTypeConfiguration<TravelAgency>
    {
        public void Configure(EntityTypeBuilder<TravelAgency> builder)
        {

            builder.ToTable("TravelAgencys", YoYoAbpefCoreConsts.SchemaNames.Common);

            
			builder.Property(a => a.TravelName).HasMaxLength(YoYoAbpefCoreConsts.EntityLengthNames.Length64);
			builder.Property(a => a.Mobile).HasMaxLength(YoYoAbpefCoreConsts.EntityLengthNames.Length64);
			builder.Property(a => a.Contacts).HasMaxLength(YoYoAbpefCoreConsts.EntityLengthNames.Length64);
			builder.Property(a => a.IsEnabled).HasMaxLength(YoYoAbpefCoreConsts.EntityLengthNames.Length64);
			builder.Property(a => a.Discount).HasMaxLength(YoYoAbpefCoreConsts.EntityLengthNames.Length64);
			builder.Property(a => a.PayMethod).HasMaxLength(YoYoAbpefCoreConsts.EntityLengthNames.Length64);
			builder.Property(a => a.TotalSum).HasMaxLength(YoYoAbpefCoreConsts.EntityLengthNames.Length64);
			builder.Property(a => a.PrepaidAmount).HasMaxLength(YoYoAbpefCoreConsts.EntityLengthNames.Length64);
			builder.Property(a => a.AlarmAmount).HasMaxLength(YoYoAbpefCoreConsts.EntityLengthNames.Length64);
			builder.Property(a => a.UpperLimit).HasMaxLength(YoYoAbpefCoreConsts.EntityLengthNames.Length64);
			builder.Property(a => a.Lowerlimit).HasMaxLength(YoYoAbpefCoreConsts.EntityLengthNames.Length64);
			builder.Property(a => a.Passward).HasMaxLength(YoYoAbpefCoreConsts.EntityLengthNames.Length64);

			builder.HasIndex(a => a.TravelName).IsUnique();
            builder.HasIndex(a => a.Mobile).IsUnique();

		}
    }
}


